import java.awt.BorderLayout;
import java.awt.Color;
import java.util.HashMap;
import java.util.Hashtable;

import gui.jquery.chrono.JFree.JFreeGraphe;
import gui.jquery.chrono.managers.GlobalManager;
import gui.jquery.chrono.views.ChronoLegendPanel;
import gui.jquery.chrono.views.FormType;

import javax.swing.JPanel;
import javax.swing.JSplitPane;

import data.Data;

/**
 * 
 * @author MAMATU
 *
 */
@SuppressWarnings("serial")
public class OngletChrono extends JOngletPanel {

	/**
	 * Create the panel.
	 */
	private ChronoLegendPanel legendPanel;
	private JPanel graphPanel;
	private JSplitPane splitPane;
	private GlobalManager manager;
	private JFreeGraphe graph; //= new JFreeGraphe("DGeographie", "DTheme",affichage);
	
	/**
	 * GET&SET
	 */
	public GlobalManager getManager() {return manager;}

	
	public OngletChrono() {
		this.setLayout(new BorderLayout());
		legendPanel = new ChronoLegendPanel();
		graphPanel = new JPanel();
		graphPanel.setBackground(Color.WHITE);	
		splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, graphPanel,legendPanel);
		
		splitPane.setResizeWeight(0.2);
		splitPane.setOneTouchExpandable(true);
		splitPane.setContinuousLayout(true);
		add(splitPane, BorderLayout.CENTER);
		
		HashMap<String, HashMap<String, Integer>> affichage = new HashMap<String, HashMap<String, Integer>>();
		graph = new JFreeGraphe("", "",affichage, FormType.CIRLCE, "Red", false);
		graphPanel.add(graph.getJFreePanel());
		
		
		/* GlobalManager */
	
		manager = new GlobalManager(legendPanel,graph,graphPanel);
		this.setData(new Data());
	}
	
	
	public void setData(Data data) {
		super.setData(data);
		manager.setData(data);
		
	}

}
